<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
 	<link rel="stylesheet" href="../static/css/back/font.css">
 	<link rel="stylesheet" href="../static/css/back/role.css">
    <link rel="stylesheet" href="../static/css/back/xadmin.css">
    <script type="text/javascript" src="../static/js/jquery-2.1.1.min.js"></script>
    
    <script type="text/javascript" src="../static/js/back/xadmin.js"></script>
    <script type="text/javascript" src="../static/js/back/ajax.js"></script>
<!--     <script type="text/javascript" src="../static/js/back/shop-info.js"></script> -->
    <style type="text/css">
.layui-upload-drag.pre{
	padding: 5px !important;
}
.layui-upload-drag.pre img{
	width:120px;
	height: 120px;
}
.layui-upload-drag+p{
	margin-top: 10px;
}
.layui-upload-list {
	text-align: -webkit-center;
}

.layui-upload {
	margin-left: 150px;
}

/*全屏显示大图*/
.opacityBottom{
    width: 100%;
    height: 100%;
    position: fixed;
    background:rgba(0,0,0,0.8);
    z-index:1000;
    top: 0;
    left: 0;
    overflow-y:auto; 
}
.none-scroll{
    overflow: hidden;
    height: 100%;
}
.bigImg{
    width:100%;
    left:0%;
    top:10%;
    z-index: 10001;
 
}
</style>
  </head>
  
  <body>
  <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="javascript:;">首页</a>
        <a href="javascript:;">门店管理</a>
        <a href="javascript:;"><cite>新增门店</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="iconfont icon-refresh right-top-ref" ></i></a>
    </div>
    <div class="x-body">
        <form class="layui-form"  onsubmit="javascript:return false;">
        <input type="hidden" id="paramKey" name="id" th:value="${shop.id}"/> 
        <input type="hidden" id="shopUserId" name="shopUserId" /> 
        
      <!--     <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		  <legend>门店二维码</legend>
		  <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		              </label>
		              <input type="hidden" name="shopLogo" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-logo" src="" th:src="${shop.shopLogo}" id="shop-logo-pre">
										  </div>
										 <p id="shop-logo-info-p"></p>
									</div>
								</div>
							</div>
						</div>
          </div> -->
		</fieldset>
    	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		  <legend>门店信息</legend>
		</fieldset>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>门店名称
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${shop.shopTitle}"></p>
              </div>
          </div>
          <div class="layui-form-item" id="x-city">
            <label class="layui-form-label"><span class="x-red">*</span>门店区域</label>
            <div class="layui-input-inline">
            	<p  class="layui-form-mid" th:text="${shop.addressProvince}+${shop.addressCity}+${shop.addressArea}"></p>
            </div>
          </div>
          <div class="layui-form-item">
              <label for="" class="layui-form-label">
                  <span class="x-red">*</span>详细地址
              </label>
              <div class="layui-input-inline">
                <p  class="layui-form-mid" th:text="${shop.addressInfo}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  坐标定位 
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.addressLocation}"></p>
              </div>
<!--                <button class="layui-btn" lay-filter="" >地图定位</button> -->
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>门店类型
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.shopType==1?'美食':'超市'}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>到期时间
              </label>
              <div class="layui-inline">
		      <div class="layui-input-inline">
		        <p  class="layui-form-mid" th:text="${#dates.format(shop.serverEndTime, 'yyyy-MM-dd')}"></p>
		      </div>
		    </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  入驻费用
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${#numbers.formatDecimal(shop.shopInCharge / 100,0,2)=='.00'?'0':#numbers.formatDecimal(shop.shopInCharge / 100,0,2)}+'元'"></p>
              </div>
 	          </div>
          <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		                <span class="x-red">*</span> 门店logo
		              </label>
		              <input type="hidden" name="shopLogo" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-logo" src="" th:src="${shop.shopLogo}" onclick="clickToBigImg(this)" id="shop-logo-pre">
										  </div>
										 <p id="shop-logo-info-p"></p>
									</div>
								</div>
							</div>
						</div>
					  <div class="layui-inline">
						  <label for="phone" class="layui-form-label">
			                <span class="x-red">*</span> 营业执照
			              </label> 
			               <input type="hidden" name="shopLicense" />
			              <div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre">
										    <img class="shop-srct" th:src="${shop.shopLicense}" onclick="clickToBigImg(this)" id="shop-srct-pre">
										  </div>
										 <p id="shop-srct-info-p"></p>
									</div>
								</div>
							</div>
		          </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>姓名
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userName}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>联系方式
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userContact}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>身份证号
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${shop.userIdCard}"></p>
              </div>
          </div>
          <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		                <span class="x-red">*</span> 手持身份证正面
		              </label>
		              <input type="hidden" name="userCardFront" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre">
										    <img class="shop-idc" th:src="${shop.userCardFront}"  onclick="clickToBigImg(this)" id="shop-idc-pre">
										  </div>
										 <p id="shop-idc-info-p"></p>
									</div>
								</div>
							</div>
						</div>
					  <div class="layui-inline">
						  <label for="phone" class="layui-form-label">
			                <span class="x-red">*</span> 卫生许可证
			              </label> 
			              <input type="hidden" name="userCardBack" />
			              <div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-idb" th:src="${shop.userCardBack}" onclick="clickToBigImg(this)" id="shop-idb-pre">
										  </div>
										 <p id="shop-idb-info-p"></p>
									</div>
								</div>
							</div>
					  </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  姓名
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userName}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="userWx" class="layui-form-label">
                  微信
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userWxName}"></p>
              </div>
          </div>
          <div class="layui-form-item">
			    <label class="layui-form-label"></label>
			    <div class="layui-input-block">
			      <input type="radio" name="shopStatus" value="3" title="通过" checked=""  lay-filter='stat'>
			      <input type="radio" name="shopStatus" value="6" title="拒绝" lay-filter='stat'>
			    </div>
		  </div>
		  <div class="layui-form-item layui-form-text mark-info hide" >
              <label for="desc" class="layui-form-label">原因 </label>
              <div class="layui-input-block">
                  <textarea placeholder="请输入拒绝原因" id="mark"  name="mark" class="layui-textarea"></textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" onclick="saveSopInfo()">确定</button>
          </div>
      </form>
    </div>
    <script>
    var stat;
    layui.use(['form','layer','laydate'], function(){
        $ = layui.jquery;
      var form = layui.form
      ,layer = layui.layer
      ,laydate = layui.laydate;
      
		    form.on('radio(stat)', function(data){
		  	  console.log(data.elem); //得到radio原始DOM对象
		  	  console.log(data.value); //被点击的radio的value值
		  	stat = data.value;
		  	  if(data.value == 6){
		  		  $('.mark-info').show();
		  	  }else{
		  		  $('.mark-info').hide();
		  	  }
		  	}); 
    })
    function saveSopInfo(){
    	console.log(123456);
    	console.log(stat);
    	var map ={};
    	map['id'] = $("#paramKey").val();
    	map['mark'] = $("#mark").val();
    	var shopst = $("input[name='shopStatus']:checked").val();
    	map['shopStatus'] = shopst;
    	_ajax_post_token('../shop/updateShopByIdperv',map,function(res){
    		if(res.resultCode == 1000){
  	      	  parent.getList();
  	      	  if(shopst == 3){
		  	      	layer.confirm('审核通过，请到门店列表查看!',function(index){
		  	      		x_admin_close();
		  	      	})
  	      	  }else if(shopst == 6){
		  	      	layer.confirm('拒绝门店入驻审核。',function(index){
		  	      		x_admin_close();
		  	      	})
  	      	  }
  	          // 获得frame索引
  	      	}else{
  	      		layer.msg('操作失败!',{icon:2,time:2000});
  	      	}
    	})
    }
    
    
    function clickToBigImg(obj){//绑定图片函数
        //var clickImgId = $(this).attr("id");
        var imgsrc = $(obj).attr("src");
        //alert (imgsrc);
        console.log(imgsrc);
        var opacityBottom = '<div title="点击图片关闭预览" id="opacityBottom" style="display: none"><img class="bigImg" src="'+ imgsrc +'" ></div>';
        $(document.body).append(opacityBottom);
        toBigImg();//变大函数
    }
    
	function toBigImg() {

		$("#opacityBottom").addClass("opacityBottom");
		$("#opacityBottom").show();
		$("html,body").addClass("none-scroll");//下层不可滑动
		$(".bigImg").addClass("bigImg");
		/*隐藏*/
		$("#opacityBottom").bind("click", clickToSmallImg);
		$(".bigImg").bind("click", clickToSmallImg);
		var imgHeight = $(".bigImg").prop("height");
		if (imgHeight < h) {
			$(".bigImg").css({
				"top" : (h - imgHeight) / 2 + 'px'
			});

		} else {
			$(".bigImg").css({
				"top" : '0px'
			});
		}
		function clickToSmallImg() {
			$("html,body").removeClass("none-scroll");
			$("#opacityBottom").remove();
		}
	};
				</script>
  </body>
</html>